package com.topideal.supplychain.hades.dict;

import org.apache.commons.lang.StringUtils;

/**
 * jira任务状态枚举
 * @author xuxiaoyan
 * @date 2018-09-11 18:40
 */
public enum IssueStatusEnum {

    OPEN("1", "open"),
    TEST("10001", "测试"),
    CHECK("10002", "验收"),
    DONE("10100", "Done"),
    INPROGRESS("10101", "In Progress"),
    TODO("10102", "To Do"),
    INREVIEW("10200", "In Review"),
    TESTING("10302", "测试中"),
    TESTED("10303", "测试完成"),
    DEVELOPED("10304", "开发完成"),
    TIDY("10306", "需求整理"),
    DEVELOPING("10307", "开发中"),
    REVIEW("10402", "评审"),
    AUDITING("10405", "审核中"),
    DEPLOYING("10406", "部署中"),
    DEALING("10408", "处理中"),
    DEALT("10409", "处理完成"),
    BACKLOG("10410", "Backlog"),
    SELECTED("10411", "Selected for Development"),
    UNDERREVIEW("10500", "Under Review"),
    APPROVED("10501", "Approved"),
    CANCELLED("10502", "Cancelled"),
    REJECTED("10503", "Rejected"),
    CHECKING("10602", "验证中"),
    ANALYZE("10700", "需求分析"),
    COMMITAUDIT("10701", "提交审核"),
    CONFIRMING("10800", "确认中"),
    CONFIRMED("10801", "已确认"),
    DEVELOP("3", "开发"),
    REOPENED("4", "Reopened"),
    VALIDATE("5", "验证"),
    CLOSE("6", "关闭")
    ;

    // 状态id
    private String value;

    // 状态名字
    private String name;

    IssueStatusEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }

    public String getValue() {
        return this.value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(String value) {
        for (IssueStatusEnum issueStatusEnum : values()) {
            if (issueStatusEnum.getValue().equals(value)) {
                return issueStatusEnum.getName();
            }
        }
        return StringUtils.EMPTY;
    }

}
